#include "StdAfx.h"
#include "DDsFrameFactory.h"
namespace dds
{
	CDDsFrameFactory::CDDsFrameFactory(void)
	{
		m_pddfFrame = NULL;
	}

	CDDsFrameFactory::~CDDsFrameFactory(void)
	{
		if( m_pddfFrame != NULL )
		{

			delete m_pddfFrame;
		}
	}
	CDdfFrame * CDDsFrameFactory::CreateFrame( int ntype )
	{
		m_nType = ntype;

		if( m_nType <= 1 )
		{
			m_pddfFrame = new dds::CDdf01Frame();
		}
		else if(m_nType == 2 )
		{
			m_pddfFrame = new dds::CDdf02Frame();
		}
		else if( m_nType == 3 )
		{
			m_pddfFrame = new dds::CDdf03Frame();
		}
		else if( m_nType == 4 )
		{
			m_pddfFrame = new dds::CDdf04Frame();
		}
		


		return m_pddfFrame;
	}

}
